<%--
    Document   : formStudents
    Created on : 30.12.2012, 17:31:11
    Author     : Martin Zmítko <martin.zmitko@gmail.com>
--%>

<%@ include file="/WEB-INF/jsp/header.jsp" %>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>

    <c:if test="${student.id != 0}">
        <form:form method="post" action="${pageContext.request.contextPath}/smazStudenta" class="pull-right">
            <input type="hidden" name="id" value="${student.id}"/>
            <input type="submit" value="<spring:message code="form.remove" />" class="myBtn myBtn-warning" />
        </form:form>
    </c:if>

      <c:if test="${student.id != 0}"> <h2>Editace studenta - ${student.lastName} ${student.firstName}</h2> </c:if>       
      <c:if test="${student.id == 0}"> <h2>Přidání studenta </h2> </c:if>
        
    <form:form class="form-horizontal" commandName="student" action="student.do">
        <c:if test="${student.id != 0}">
            <div class="control-group">
                <label class="control-label" for="inputName"><spring:message code="form.id" />:</label>
                <div class="controls">
                    <form:hidden path="id" readonly="true" /> <span>${student.id}</span>
                </div>
            </div>
        </c:if>
        <div class="control-group">
            <label class="control-label" for="inputFirstName"><spring:message code="form.firstName" />:</label>
            <div class="controls">
                <form:input path="firstName" id="inputFirstName" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputLastName"><spring:message code="form.lastName" />:</label>
            <div class="controls">
                <form:input path="lastName" id="inputLastName" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputAddress"><spring:message code="form.address" />:</label>
            <div class="controls">
                <form:input path="address" id="inputAddress" />
            </div>
        </div>
         <div class="control-group">
            <label class="control-label" for="inputYearOfBirth"><spring:message code="form.yearOfBirth" />:</label>
            <div class="controls">
                <form:input path="yearOfBirth" id="inputYearOfBirth" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputCity"><spring:message code="form.city" />:</label>
            <div class="controls">
                <form:input path="city" id="inputCity" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputTelephone"><spring:message code="form.telephone" />:</label>
            <div class="controls">
                <form:input path="telephone" id="inputTelephone" />
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <input type="submit" value="<spring:message code="form.save" />" class="myBtn" />
            </div>
        </div>
    </form:form>

<%@ include file="/WEB-INF/jsp/footer.jsp" %>